#include "Heap.h"

void test1()
{
	Heap h;
	HeapInit(&h);

	HeapPush(&h, 5);
	HeapPush(&h, 4);
	HeapPush(&h, 4);
	HeapPush(&h, 3);
	HeapPush(&h, 4);
	HeapPush(&h, 2);
	HeapPush(&h, 1);

	printf("%d\n", HeapSize(&h));

	while (!HeapEmpty(&h))
	{
		printf("%d ", HeapTop(&h));
		HeapPop(&h);
	}

	HeapDestroy(&h);
}

void test2()
{
	Heap h;
	HeapInit(&h);

	HPDataType arr[10] = { 10, 8, 6, 2, 1, 5, 3, 4, 9, 7 };
	HeapCreate(&h, arr, 10);

	printf("%d\n", HeapSize(&h));

	while (!HeapEmpty(&h))
	{
		printf("%d ", HeapTop(&h));
		HeapPop(&h);
	}

	HeapDestroy(&h);

}

int main()
{
	test1();
	test2();

	return 0;
}

